function K_NS()
{
//让点沿轨迹移动的类
	function K_PointMover(points,time,rate,handle)
	{
		this.points=points;
		this.time=time?time:100;
		this.rate=rate?rate:1;
		this.handle=handle;
		this.pointsIndex=0;
		this.numberIndex=0;
	}
	K_PointMover.prototype.Move=function()
	{
		if(!this.timer)
		{
			this.timer=setInterval(K_Function.GetCallBack(this,this.Move),this.time);
			this.point=this.points[this.pointsIndex];
			if(this.handle)
			{
				this.handle.call(null,this);
			}
			return;
		}
		else
		{
			if(!this.offset)
			{
				offsetX=this.points[this.pointsIndex+1].lng()-this.points[this.pointsIndex].lng();
				a=Math.log((1+Math.sin(this.points[this.pointsIndex].lat()*Math.PI/180))/(1-Math.sin(this.points[this.pointsIndex].lat()*Math.PI/180)))*180/Math.PI/2;
				a1=Math.log((1+Math.sin(this.points[this.pointsIndex+1].lat()*Math.PI/180))/(1-Math.sin(this.points[this.pointsIndex+1].lat()*Math.PI/180)))*180/Math.PI/2;
				offsetY=a1-a;//this.points[this.pointsIndex+1].lat()-this.points[this.pointsIndex].lat();
				offset=Math.sqrt(Math.pow(offsetX,2)+Math.pow(offsetY,2));
				if(offset==0)
					this.offset=new GSize(0,0);
				else
					this.offset=new GSize(offsetX/offset,offsetY/offset);
			}
			var lng=this.points[this.pointsIndex].lng()+this.rate*this.offset.width*(this.numberIndex+1);
			var lat=Math.log((1+Math.sin(this.points[this.pointsIndex].lat()*Math.PI/180))/(1-Math.sin(this.points[this.pointsIndex].lat()*Math.PI/180)))*180/Math.PI/2+this.rate*this.offset.height*(this.numberIndex+1);
			lat=(Math.asin((Math.pow(Math.E,lat*Math.PI/180*2)-1)/(Math.pow(Math.E,lat*Math.PI/180*2)+1))*180/Math.PI);
			if((lng-this.points[this.pointsIndex].lng())*(lng-this.points[this.pointsIndex+1].lng())<0 || (lat-this.points[this.pointsIndex].lat())*(lat-this.points[this.pointsIndex+1].lat())<0)
			{
				this.point=new GLatLng(lat,lng);
				if(this.handle)
					this.handle.call(null,this);
				this.numberIndex++;
			}
			else
			{
				this.pointsIndex++;
				this.numberIndex=0;
				this.offset=null;
				this.point=this.points[this.pointsIndex];
				if(this.handle)
					this.handle.call(null,this);
				if(this.pointsIndex>=this.points.length-1)
				{
					clearInterval(this.timer);
					this.pointsIndex=0;
					this.numberIndex=0;
				}
			}
		}
	}
	K_PointMover.prototype.Pause=function()
	{
		if(this.timer)
		{
			clearInterval(this.timer);
			this.timer=null;
		}
	}
	window.K_PointMover=K_PointMover;
}K_NS();